//
// NewtonMethod.cpp
// Newton fixed point method implementation.
//
// Author: Gabriel H. Barbuto (gbarbuto@dc.uba.ar)
//
#include <cstddef>
#include <functional>

#include "FixedPointMethod.h"
#include "NewtonMethod.h"

NewtonMethod::NewtonMethod(std::function<double(double)> const &f, std::function<double(double)> const &df, std::size_t const &iterations) :
FixedPointMethod([f, df](double const &x) { return x - f(x) / df(x); }, iterations)
{
}

NewtonMethod::NewtonMethod(std::function<double(double)> const &f, std::function<double(double)> const &df, double const &epsilon, std::size_t const &iterations) :
FixedPointMethod([f, df](double const &x) { return x - f(x) / df(x); }, epsilon, iterations)
{
}

